package com.xuanyuan.viewfunc.mask

import android.os.Bundle
import android.view.View
import com.xuanyuan.baselibaray.BaseActivity
import com.xuanyuan.viewfunc.R
import com.xuanyuan.viewfunc.databinding.ActivityLayoutMaskBinding

/**
 * Copyright (C), 2017-2022, Anker
 * FileName: LayoutMaskActivity  View蒙层
 *
 * @author ken.luo
 * Date: 2022/6/3 17:27
 * Description: 常见的Layout蒙层方式
 * History:
 * 创建者 : ken.luo
 * <author>     <time>     <version>      <desc>
 * 作者姓名      修改时间      版本号          描述
</desc></version></time></author> */
class LayoutMaskActivity : BaseActivity<ActivityLayoutMaskBinding>(), View.OnClickListener {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding.click = this

    }

    override fun initLayout(): Int {
        return R.layout.activity_layout_mask
    }


    override fun onClick(v: View?) {
        if (v == null) {
            return
        }

        when (v) {
            mBinding.btnColor1 -> {
                mBinding.image.setColorFilter(resources.getColor(R.color.color10))
            }
            mBinding.btnColor2 -> {
                mBinding.image.setColorFilter(resources.getColor(R.color.color20))
            }
            mBinding.btnColor3 -> {
                mBinding.image.setColorFilter(resources.getColor(R.color.color30))
            }
            mBinding.btnColor4 -> {
                mBinding.image.setColorFilter(resources.getColor(R.color.color40))
            }
            mBinding.layoutMask.btnGotIt -> {
                mBinding.layoutMask.root.visibility = View.GONE
            }
        }

    }


}